import React, { Component } from 'react'
import { Consumer } from '../utils/context'


class Son extends Component {
    render() {
        return (
            <div>
                {/* Context.Consumer中必须定义一个函数 */}
                <Consumer>
                    {
                        (data) => {
                            console.log(data)
                            return <h5>我是子组件--{ data }</h5>
                        }
                    }
                </Consumer>
            </div>
        )
    }
}

export default Son